﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace examss
{
    class Class3
    {
        static void Main(string[] args)
        {
            father f = new father();
            son s = new son();
            Console.WriteLine(f.initName("亚瑟"));
            Console.WriteLine(f.initBlood());
            Console.WriteLine(f.initRange());
            f.haul();
            s.attach();
            Console.ReadKey();
        }
    }
    class father
    {
        string name = string.Empty;
        int blood = 0;
        int range = 0;
        public string initName(string n)
        {
            name = n;
            return name;
        }
        public int initBlood()
        {
            blood = 100;
            return blood;
        }
        public int initRange()
        {
            range = 1;
            return range;
        }
        public void haul()
        {
            Console.WriteLine("此路是我开，哪里走！");//输出
        }
        public virtual void attach()
        {
            Console.WriteLine("我发起了普通攻击");

        }
    }
    class son : father
    {
        public override void attach()
        {
            Console.WriteLine("小兵发起了攻击");

        }
    }
}
